This will enable passing `-C rpath` on all compiles to rustc itself.
Closes #705
opt_level: uint,
codegen_units: Option<uint>, // None = use rustc default
debug: bool,
+ rpath: bool,
test: bool,
doctest: bool,
doc: bool,
opt_level: 0,
codegen_units: None,
debug: false,
+ rpath: false,
test: false,
doc: false,
dest: None,
self.debug
}
+ pub fn get_rpath(&self) -> bool {
+ self.rpath
+ }
+
pub fn get_env(&self) -> &str {
self.env.as_slice()
}
self
}
+ pub fn rpath(mut self, rpath: bool) -> Profile {
+ self.rpath = rpath;
+ self
+ }
+
pub fn test(mut self, test: bool) -> Profile {
self.test = test;
self
opt_level,
codegen_units,
debug,
+ rpath,
plugin,
dest: ref dest,
harness: harness,
test: _,
doctest: _,
} = *self;
- (opt_level, codegen_units, debug, plugin, dest, harness).hash(into)
+ (opt_level, codegen_units, debug, rpath, plugin, dest, harness).hash(into)
}
}
let root_profile = target.get_profile();
if root_profile.get_env() != profile.get_env() { continue }
profile = profile.opt_level(root_profile.get_opt_level())
- .debug(root_profile.get_debug());
+ .debug(root_profile.get_debug())
+ .rpath(root_profile.get_rpath())
}
if profile.get_opt_level() != 0 {
None => {}
}
+ if profile.get_rpath() {
+ cmd = cmd.arg("-C").arg("rpath");
+ }
+
return cmd;
}
opt_level: Option<uint>,
codegen_units: Option<uint>,
debug: Option<bool>,
+ rpath: Option<bool>,
}
#[deriving(Decodable)]
let opt_level = toml.opt_level.unwrap_or(profile.get_opt_level());
let codegen_units = toml.codegen_units;
let debug = toml.debug.unwrap_or(profile.get_debug());
+ let rpath = toml.rpath.unwrap_or(profile.get_rpath());
profile.opt_level(opt_level).codegen_units(codegen_units).debug(debug)
+ .rpath(rpath)
}
fn target_profiles(target: &TomlTarget, profiles: &TomlProfiles,
[profile.dev]
opt-level = 1
debug = false
+ rpath = true
"#)
.file("src/lib.rs", "");
assert_that(p.cargo_process("build").arg("-v"),
--cfg ndebug \
-C metadata=[..] \
-C extra-filename=-[..] \
+ -C rpath \
--out-dir {dir}{sep}target \
--dep-info [..] \
-L {dir}{sep}target \